import moment from 'moment'

export function getCurrentDate() {
  return moment(new Date()).format("YYYY-MM-DD")
}

export function getCurrentDateTime() {
  return moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
}

export function formatDateTime(datetime, format) {
  const cformat = format || "YYYY-MM-DD HH:mm"
  if (!datetime) return null
  return moment(datetime).format(cformat);
}

export function getCurDate(format) {
  return moment(new Date()).format(format)
}